<?php

namespace app\admin\validate\Coupon;

use think\Validate;

class Brand extends Validate
{
    protected $rule = [
        'id'        => 'require',
        'name'      => 'require|max:25',
        'image_url' => 'require',
        'status'    => 'require',
        'sort'      => 'require|number|egt:1',
    ];

    protected $message = [
        'id.require'        => '编号错误！',
        'name.require'      => '品牌名称不能为空',
        'image_url.require' => '品牌图标不能为空',
        'status.require'    => '状态不能为空',
        'sort.require'      => '排序不能为空',
        'name.max'          => '品牌名称不能超过25个字符',
        'sort.number'       => '排序必须是数字',
        'sort.egt'          => '排序必须大于等于1',
    ];

    protected $scene = [
        'add_brand'  => ['name',"image_url",'status','sort'],
        'edit_brand' => ['id', 'name',"image_url",'status','sort'],
        'set_status' => ['id','status']
    ];
}
